<?php

/**
 * IndexController - The default controller class
 * 
 * @author
 * @version 
 */

require_once 'Zend/Controller/Action.php';

class IndexController extends Zend_Controller_Action 
{
	private $_usuario;
	
    public function preDispatch() {
      if (!Zend_Auth::getInstance()->hasIdentity()) {
      	$this->_redirect('login');
      } else {
      	$config = Zend_Registry::get ( 'config' );
      	$this->_session = new Zend_Session_Namespace ( $config->session->namespace );
		$this->_usuario = $this->_session->storage;
      }
    }
	
	/**
	 * The default action - show the home page
	 */
    public function indexAction() 
    {
        $this->view->form = new FormLogin(array('action' => 'users/login'));
    }
    
}
